import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'amfe-flexible'
import 'highlight.js/styles/default.css' // 代码高亮的样式
import { timeAgo } from './utils/moment'
import './vant'

import './directive'
// 注册为全局对象
import ArticleItem from './components/articleItem'
// Vue.component('ArticleItem', ArticleItem)
Vue.component(ArticleItem.name, ArticleItem)

Vue.prototype.$time = timeAgo

Vue.config.productionTip = false
// 去掉打印
if (process.env.NODE_ENV !== 'development') { // process是Node环境全部变量, 运行时根据敲击的命令不同, 脚手架会取环境变量给env添加属性和值
  console.log = function () {}
  console.error = function () {}
  console.dir = function () {}
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
